<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>
<style>
    body,
    div,
    ul,
    li,
    h2 {
        margin: 0;
        padding: 0;
    }
    
    body {
        font: 12px;
    }
    
    ul {
        list-style-type: none;
    }
    
    #a {
        width: 500px;
        border: 1px solid #CCC;
        margin: 10px auto;
    }
    
    #a h2 {
        cursor: pointer;
        color: #CCC;
        font-size: 14px;
        font-weight: 400;
        border: 1px solid;
        height: 30px;
        line-height: 30px;
        padding-left: 10px;
        background: #fff url(img/ico.gif) 180px 15px no-repeat;
        border-color: #fff #e9edf2;
    }
    
    #a h2.open {
        background-position: 180px -12px;
    }
    
    #a ul {
        border-top: 1px solid #DEE3E6;
    }
    
    #a li {
        height: 25px;
        line-height: 25px;
        vertical-align: top;
    }
    
    #a a {
        display: block;
        color: #CCC;
        background: CCC;
        text-decoration: none;
        padding: 0 10px;
    }
    
    #a a:hover {
        background: #fff;
        text-decoration: underline;
    }
</style>

<body>
    <div id="a">
        <h2>方东升</h2>
        <ul>
            <li><a href="javascript:;">安馨萍</a></li>
            <li><a href="javascript:;">安馨萍</a></li>
            <li><a href="javascript:;">安馨萍</a></li>
            <li><a href="javascript:;">安馨萍</a></li>
            <li><a href="javascript:;">安馨萍</a></li>
            <li><a href="javascript:;">安馨萍</a></li>
        </ul>
    </div>
</body>
<script>
    var a = document.getElementsByTagName("h2")[0];
    var b = document.getElementsByTagName("ul")[0];
    a.onclick = function() {
        var style = b.style;
        style.display = style.display == "none" ? "block" : "none";
        a.className = style.display == "none" ? "open" : ""
    }
</script>

</html>